package com.waar.kickball.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

/**
 * @author Craig McIlwee
 * Copyright Lance + Craig 2013
 */
@Entity
@Table(name = "player")
public class Player extends KickballEntity {

	@Column(name = "first_name", nullable = false)
	private String firstName;
	@Column(name = "last_name", nullable = false)
	private String lastName;
	@Enumerated(EnumType.STRING)
	private Sex sex;
	@Column(name = "phone_number", nullable = false, length = 10)
	private String phoneNumber;
	@Enumerated(EnumType.STRING)
	private Position preferredPosition;
	
	Player() { }
	
	/**
	 * @param firstName player's first name
	 * @param lastName player's last name
	 * @param sex of the player
	 * @param phoneNumber 10 digit phone number
	 */
	public Player(String firstName, String lastName, Sex sex,
			String phoneNumber) {
		this.firstName = firstName;
		this.lastName = lastName;
		this.sex = sex;
		this.phoneNumber = phoneNumber;
	}
	
	/**
	 * @return the player's first name
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	
	/**
	 * @return the player's last name
	 */
	public String getLastName() {
		return lastName;
	}
	
	/**
	 * @param lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	/**
	 * @return the player's sex
	 */
	public Sex getSex() {
		return sex;
	}
	
	/**
	 * @param sex to set
	 */
	public void setSex(Sex sex) {
		this.sex = sex;
	}
	
	/**
	 * @return the player's 10 digit phone number
	 */
	public String getPhoneNumber() {
		return phoneNumber;
	}
	
	/**
	 * @param phoneNumber to set
	 */
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	/**
	 * @return the player's preferred position, may be null
	 */
	public Position getPreferredPosition() {
		return preferredPosition;
	}
	
	/**
	 * @param preferredPosition to set
	 */
	public void setPreferredPosition(Position preferredPosition) {
		this.preferredPosition = preferredPosition;
	}
	
}
